<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initDb()
    {
        // Setup database
        $db = Zend_Db::factory('Pdo_Mysql', array ('host' => 'localhost', 
                                                    'username' => 'root',
                                                    'password' => '',
                                                    'dbname' => 'spamanager'));
        $db->setFetchMode(Zend_Db::FETCH_OBJ);
        //$db->query("SET NAMES 'utf8'");
        //$db->query("SET CHARACTER SET 'utf8'");
        
       
        Zend_Registry::set('DB',$db);
        //Khi thiet lap che do nay model moi co the su dung duoc
        Zend_Db_Table::setDefaultAdapter($db);
        // Return it, so that it can be stored by the bootstrap
        return $db;
    }
	protected function _initRoute()
	{
		/*$font = Zend_Controller_Front::getInstance();
		$router = $font->getRouter();
		$router->addRoute('hocchan',
						new Zend_Controller_Router_Route('/*',
                             array(    
                            'module' => 'default',
                            'controller' => 'index',
                            'action' => 'index',
                            'languageCode' => 'vn'
                                    ))
                          );		*/
	}
	protected function _initLocalTime()
	{
		date_default_timezone_set('America/New_York');
		$locate = Zend_Locale::setDefault("en_US");
		Zend_Registry::set("Zend_Locale",$locate);
	}
}

